package wqh.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import wqh.dao.WaterChannelAlarmDao;
import wqh.domain.WaterChannelAlarm;
import wqh.service.WaterChannelAlarmService;

import java.util.List;

/**
 * Created by wqh on 2017/1/19.
 */
@Service("waterChannelAlarmService")
public class WaterChannelAlarmServiceImpl  implements WaterChannelAlarmService{

    @Autowired
    private WaterChannelAlarmDao dao;

    @Override
    public void save(WaterChannelAlarm entity) {
        this.dao.save(entity);
    }

    @Override
    public void update(WaterChannelAlarm entity) {
        this.dao.update(entity);
    }

    @Override
    public void delete(WaterChannelAlarm entity) {
        this.dao.delete(entity);
    }

    @Override
    public void deleteAll() {
        this.dao.deleteAll();
    }

    @Override
    public List<WaterChannelAlarm> findAll() {
        return this.dao.findAll();
    }

    @Override
    public WaterChannelAlarm findById(Long id) {
        return this.dao.findById(id);
    }

    @Override
    public List<WaterChannelAlarm> findByDeviceIdAndChannelNumber(Long device_id, Integer channel_number) {
        return this.dao.findByDeviceIdAndChannelNumber(device_id, channel_number);
    }

    @Override
    public void deleteByDeviceIdAndChannelNumber(Long device_id, Integer channel_number) {
        this.dao.deleteByDeviceIdAndChannelNumber(device_id, channel_number);
    }

    @Override
    public Long countByTimeRange(Integer start, Integer end) {
        return this.dao.countByTimeRange(start, end);
    }
}
